package com.logistica.metropolitana.web.controllers;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
public class Error403Controller {

	private final Logger logger = LoggerFactory.getLogger(Error403Controller.class);	
	
	@RequestMapping(method = RequestMethod.GET)	
	public String showErrorCodeGet(HttpServletRequest request){
		logger.info("Error 403 Message - Access Denied");

		//if(SecurityUtils.isAuthenticated(request)){
			//return "redirect:/bestBets/bestBetsHome.htm";
			//return "forward:/bestBetsErrorNoAuthorizedMsg.htm";
		//}

		String notAuthorizedMessage = "Not Authorized Message";
		request.getSession().setAttribute("notAuthorizedMessage", notAuthorizedMessage);

		return "redirect:/login.htm";
	}
}
